home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / info / maxima.info-3 < prev    next >
Encoding:
GNU Info File  |  2003-02-09  |  30.3 KB  |  763 lines

  1. This is maxima.info, produced by makeinfo version 4.1 from maxima.texi.
  2.  
  3.    This is a Texinfo Maxima Manual
  4.  
  5.    Copyright 1994,2001 William F. Schelter
  6.  
  7. START-INFO-DIR-ENTRY
  8. * Maxima: (maxima).     A computer algebra system.
  9. END-INFO-DIR-ENTRY
  10.  
  11. 
  12. File: maxima.info,  Node: Simplification,  Next: Plotting,  Prev: Expressions,  Up: Top
  13.  
  14. Simplification
  15. **************
  16.  
  17. * Menu:
  18.  
  19. * Definitions for Simplification::
  20.  
  21. 
  22. File: maxima.info,  Node: Definitions for Simplification,  Prev: Simplification,  Up: Simplification
  23.  
  24. Definitions for Simplification
  25. ==============================
  26.  
  27. * Menu:
  28.  
  29.  - Function: APPLY_NOUNS (exp)
  30.      causes the application of noun forms in an expression.  E.g.
  31.      EXP:'DIFF(X^2/2,X); APPLY_NOUNS(EXP); gives X.  This gives the
  32.      same result as EV(EXP,NOUNS); except that it can be faster and use
  33.      less storage.  It also can be used in translated code, where EV
  34.      may cause problems.  Note that it is called APPLY_NOUNS, not
  35.      EV_NOUNS, because what it does is to APPLY the rules corresponding
  36.      to the noun-form operators, which is not evaluation.
  37.  
  38.  
  39.  - Variable: ASKEXP
  40.      default: [] contains the expression upon which ASKSIGN is called.
  41.      A user may enter a MACSYMA break with ^A and inspect this
  42.      expression in order to answer questions asked by ASKSIGN.
  43.  
  44.  - Function: ASKINTEGER (exp,<optional-arg>)
  45.      exp is any valid macsyma expression and optional-arg is
  46.      EVEN,ODD,INTEGER and defaults to INTEGER if not given.  This
  47.      function attempts to determine from the data-base whether exp is
  48.      EVEN, ODD or just an INTEGER.  It will ask the user if it cannot
  49.      tell otherwise and attempt to install the information in the
  50.      data-base if possible.
  51.  
  52.  
  53.  - Function: ASKSIGN (exp)
  54.      first attempts to determine whether the specified expression is
  55.      positive, negative, or zero.  If it cannot, it asks the user the
  56.      necessary questions to complete its deduction.  The user's answer
  57.      is recorded in the data base for the duration of the current
  58.      computation (one "C-line"). The value of ASKSIGN is one of POS,
  59.      NEG, or ZERO.
  60.  
  61.  
  62.  - Variable: DEMOIVRE
  63.      default: [FALSE] if TRUE will cause
  64.           %E^(A+B*%I) ==> %E^A*(COS(B)+%I*SIN(B))
  65.      if B is free of %I.  A and B are not expanded.  DEMOIVRE:TRUE; is
  66.      the way to reverse the effect of EXPONENTIALIZE:TRUE;
  67.  
  68.      DEMOIVRE(exp) will cause the conversion without setting the switch
  69.      or having to re-evaluate the expression with EV.
  70.  
  71.  
  72.  - Variable: DOMAIN
  73.      default: [REAL] - if set to COMPLEX, SQRT(X^2) will remain
  74.      SQRT(X^2) instead of returning ABS(X).  The notion of a "domain" of
  75.      simplification is still in its infancy, and controls little more
  76.      than this at the moment.
  77.  
  78.  
  79.  - Function: EXPAND (exp)
  80.      will cause products of sums and exponentiated sums to be
  81.      multiplied out, numerators of rational expressions which are sums
  82.      to be split into their respective terms, and multiplication
  83.      (commutative and non-commutative) to be distributed over addition
  84.      at all levels of exp.  For polynomials one should usually use
  85.      RATEXPAND which uses a more efficient algorithm (see
  86.      DESCRIBE(RATEXPAND);).  MAXNEGEX[1000] and MAXPOSEX[1000] control
  87.      the maximum negative and positive exponents, respectively, which
  88.      will expand.  EXPAND(exp,p,n) expands exp, using p for MAXPOSEX
  89.      and n for MAXNEGEX.  This is useful in order to expand part but
  90.      not all of an expression.  EXPON[0] - the exponent of the largest
  91.      negative power which is automatically expanded (independent of
  92.      calls to EXPAND).  For example if EXPON is 4 then (X+1)^(-5) will
  93.      not be automatically expanded.  EXPOP[0] - the highest positive
  94.      exponent which is automatically expanded.  Thus (X+1)^3, when
  95.      typed, will be automatically expanded only if EXPOP is greater
  96.      than or equal to 3.  If it is desired to have (X+1)^N expanded
  97.      where N is greater than EXPOP then executing EXPAND((X+1)^N) will
  98.      work only if MAXPOSEX is not less than N.  The EXPAND flag used
  99.      with EV (see EV) causes expansion.
  100.  
  101.      The file `simplification/facexp.mac' contains several related
  102.      functions (in particular FACSUM, FACTORFACSUM and COLLECTTERMS,
  103.      which are autoloaded) and variables (NEXTLAYERFACTOR and
  104.      FACSUM_COMBINE) that provide the user with the ability to structure
  105.      expressions by controlled expansion.  Brief function descriptions
  106.      are available in `simplification/facexp.usg'.  A demo is available
  107.      by doing `demo("facexp")$'.
  108.  
  109.  
  110.  - Function: EXPANDWRT (exp,var1,var2,...)
  111.      expands exp with respect to the vari.  All products involving the
  112.      vari appear explicitly.  The form returned will be free of
  113.      products of sums of expressions that are not free of the vari.
  114.      The vari may be variables, operators, or expressions.  By default,
  115.      denominators are not expanded, but this can be controlled by means
  116.      of the switch EXPANDWRT_DENOM.  This function is autoloaded from
  117.      `simplification/stopex.mac'.
  118.  
  119.  
  120.  - Variable: EXPANDWRT_DENOM
  121.      default:[FALSE] controls the treatment of rational expressions by
  122.      EXPANDWRT.  If TRUE, then both the numerator and denominator of
  123.      the expression will be expanded according to the arguments of
  124.      EXPANDWRT, but if EXPANDWRT_DENOM is FALSE, then only the
  125.      numerator will be expanded in that way.
  126.  
  127.  
  128.  - Function: EXPANDWRT_FACTORED (exp, var1, var2, ..., varN)
  129.      is similar to EXPANDWRT, but treats expressions that are products
  130.      somewhat differently.  EXPANDWRT_FACTORED will perform the
  131.      required expansion only on those factors of exp that contain the
  132.      variables in its argument list argument list.  This function is
  133.      autoloaded from `simplification/stopex.mac'.
  134.  
  135.  
  136.  - Variable: EXPON
  137.      default: [0] - the exponent of the largest negative power which is
  138.      automatically expanded (independent of calls to EXPAND).  For
  139.      example if EXPON is 4 then (X+1)^(-5) will not be automatically
  140.      expanded.
  141.  
  142.  
  143.  - Variable: EXPONENTIALIZE
  144.      default: [FALSE] if TRUE will cause all circular and hyperbolic
  145.      functions to be converted to exponential form.  (Setting
  146.      DEMOIVRE:TRUE; will reverse the effect.)  EXPONENTIALIZE(exp) will
  147.      cause the conversion to exponential form of an expression without
  148.      setting the switch or having to re-evaluate the expression with EV.
  149.  
  150.  
  151.  - Variable: EXPOP
  152.      default: [0] - the highest positive exponent which is
  153.      automatically expanded.  Thus (X+1)^3, when typed, will be
  154.      automatically expanded only if EXPOP is greater than or equal to 3.
  155.      If it is desired to have (X+1)^n expanded where n is greater than
  156.      EXPOP then executing EXPAND((X+1)^n) will work only if MAXPOSEX is
  157.      not less than n.
  158.  
  159.  
  160.  - Variable: FACTLIM
  161.      default: [-1] gives the highest factorial which is automatically
  162.      expanded.  If it is -1 then all integers are expanded.
  163.  
  164.  
  165.  - Function: INTOSUM (expr)
  166.      will take all things that a summation is multiplied by, and put
  167.      them inside the summation. If the index is used in the outside
  168.      expression, then the function tries to find a reasonable index,
  169.      the same as it does for SUMCONTRACT.  This is essentially the
  170.      reverse idea of the OUTATIVE property of summations, but note that
  171.      it does not remove this property, it only bypasses it.  In some
  172.      cases, a SCANMAP(MULTTHRU,expr) may be necessary before the
  173.      INTOSUM.
  174.  
  175.  
  176.  - declaration: LASSOCIATIVE
  177.      - If DECLARE(G,LASSOCIATIVE); is done, this tells the simplifier
  178.      that G is left-associative.  E.g.  G(G(A,B),G(C,D)) will simplify
  179.      to G(G(G(A,B),C),D).
  180.  
  181.  
  182.  - declaration: LINEAR
  183.      - One of MACSYMA's OPPROPERTIES.  For univariate f so declared,
  184.      "expansion" F(X+Y) -> F(X)+F(Y), F(A*X) -> A*F(X) takes place
  185.      where A is a "constant".  For functions F of >=2 args, "linearity"
  186.      is defined to be as in the case of 'SUM or 'INTEGRATE, i.e.
  187.      F(A*X+B,X) -> A*F(X,X)+B*F(1,X) for A,B FREEOF X.  (LINEAR is just
  188.      ADDITIVE + OUTATIVE.)
  189.  
  190.  
  191.  - declaration: MAINVAR
  192.      - You may DECLARE variables to be MAINVAR.  The ordering scale for
  193.      atoms is essentially: numbers < constants (e.g. %E,%PI) < scalars
  194.      < other variables < mainvars.  E.g. compare EXPAND((X+Y)^4); with
  195.      (DECLARE(X,MAINVAR), EXPAND((X+Y)^4)); .  (Note: Care should be
  196.      taken if you elect to use the above feature.  E.g. if you subtract
  197.      an expression in which X is a MAINVAR from one in which X isn't a
  198.      MAINVAR, resimplification e.g. with EV(expression,SIMP) may be
  199.      necessary if cancellation is to occur.  Also, if you SAVE an
  200.      expression in which X is a MAINVAR, you probably should also SAVE
  201.      X.)
  202.  
  203.  
  204.  - Variable: MAXAPPLYDEPTH
  205.      default: [10000] - the maximum depth to which APPLY1 and APPLY2
  206.      will delve.
  207.  
  208.  
  209.  - Variable: MAXAPPLYHEIGHT
  210.      default: [10000] - the maximum height to which APPLYB1 will reach
  211.      before giving up.
  212.  
  213.  
  214.  - Variable: MAXNEGEX
  215.      default: [1000] - the largest negative exponent which will be
  216.      expanded by the EXPAND command (see also MAXPOSEX).
  217.  
  218.  
  219.  - Variable: MAXPOSEX
  220.      default: [1000] - the largest exponent which will be expanded with
  221.      the EXPAND command (see also MAXNEGEX).
  222.  
  223.  
  224.  - declaration: MULTIPLICATIVE
  225.      - If DECLARE(F,MULTIPLICATIVE) has been executed, then: (1) If F
  226.      is univariate, whenever the simplifier encounters F applied to a
  227.      product, F will be distributed over that product.  I.e. F(X*Y);
  228.      will simplify to F(X)*F(Y).  (2) If F is a function of 2 or more
  229.      arguments, multiplicativity is defined as multiplicativity in the
  230.      first argument to F, i.e.  F(G(X)*H(X),X); will simplify to
  231.      F(G(X),X)*F(H(X),X).  This simplification does not occur when F is
  232.      applied to expressions of the form
  233.      PRODUCT(X[I],I,lower-limit,upper-limit).
  234.  
  235.  
  236.  - Variable: NEGDISTRIB
  237.      default: [TRUE] - when TRUE allows -1 to be distributed over an
  238.      expression.  E.g. -(X+Y) becomes -Y-X.  Setting it to FALSE will
  239.      allow -(X+Y) to be displayed like that.  This is sometimes useful
  240.      but be very careful: like the SIMP flag, this is one flag you do
  241.      not want to set to FALSE as a matter of course or necessarily for
  242.      other than local use in your MACSYMA.
  243.  
  244.  
  245.  - Variable: NEGSUMDISPFLAG
  246.      default: [TRUE] - when TRUE, X-Y displays as X-Y instead of as
  247.      -Y+X.  Setting it to FALSE causes the special check in display for
  248.      the difference of two expressions to not be done.  One application
  249.      is that thus A+%I*B and A-%I*B may both be displayed the same way.
  250.  
  251.  
  252.  - special symbol: NOEVAL
  253.      - suppresses the evaluation phase of EV.  This is useful in
  254.      conjunction with other switches and in causing expressions to be
  255.      resimplified without being reevaluated.
  256.  
  257.  
  258.  - declaration: NOUN
  259.      - One of the options of the DECLARE command.  It makes a function
  260.      so DECLAREd a "noun", meaning that it won't be evaluated
  261.      automatically.
  262.  
  263.  
  264.  - Variable: NOUNDISP
  265.      default: [FALSE] - if TRUE will cause NOUNs to display with a
  266.      single quote.  This switch is always TRUE when displaying function
  267.      definitions.
  268.  
  269.  
  270.  - special symbol: NOUNS
  271.      (EVFLAG) when used as an option to the EV command, converts all
  272.      "noun" forms occurring in the expression being EV'd to "verbs",
  273.      i.e.  evaluates them.  See also NOUN, NOUNIFY, VERB, and VERBIFY.
  274.  
  275.  
  276.  - special symbol: NUMER
  277.      causes some mathematical functions (including exponentiation) with
  278.      numerical arguments to be evaluated in floating point. It causes
  279.      variables in exp which have been given numervals to be replaced by
  280.      their values.  It also sets the FLOAT switch on.
  281.  
  282.  
  283.  - Function: NUMERVAL (var1, exp1, var2, exp2, ...)
  284.      declares vari to have a numerval of expi which is evaluated and
  285.      substituted for the variable in any expressions in which the
  286.      variable occurs if the NUMER flag is TRUE. (see the EV function).
  287.  
  288.  
  289.  - Variable: OPPROPERTIES
  290.      - the list of the special operator-properties handled by the
  291.      MACSYMA simplifier: LINEAR, ADDITIVE, MULTIPLICATIVE, OUTATIVE,
  292.      EVENFUN, ODDFUN, COMMUTATIVE, SYMMETRIC, ANTISYMMETRIC, NARY,
  293.      LASSOCIATIVE, and RASSOCIATIVE.
  294.  
  295.  
  296.  - Variable: OPSUBST
  297.      default:[TRUE] - if FALSE, SUBST will not attempt to substitute
  298.      into the operator of an expression.  E.g. (OPSUBST:FALSE,
  299.      SUBST(X^2,R,R+R[0])); will work.
  300.  
  301.  
  302.  - declaration: OUTATIVE
  303.      - If DECLARE(F,OUTATIVE) has been executed, then: (1) If F is
  304.      univariate, whenever the simplifier encounters F applied to a
  305.      product, that product will be partitioned into factors that are
  306.      constant and factors that are not and the constant factors will be
  307.      pulled out.  I.e. F(A*X); will simplify to A*F(X) where A is a
  308.      constant.  Non-atomic constant factors will not be pulled out.
  309.      (2) If F is a function of 2 or more arguments, outativity is
  310.      defined as in the case of 'SUM or 'INTEGRATE, i.e. F(A*G(X),X);
  311.      will simplify to A*F(G(X),X) for A free-of X.  Initially, 'SUM,
  312.      'INTEGRATE, and 'LIMIT are declared to be OUTATIVE.
  313.  
  314.  
  315.  - declaration: POSFUN
  316.      - POSitive FUNction, e.g. DECLARE(F,POSFUN); IS(F(X)>0); -> TRUE.
  317.  
  318.  
  319.  - Variable: PRODHACK
  320.      default: [FALSE] - if set to TRUE then PRODUCT(F(I),I,3,1); will
  321.      yield 1/F(2), by the identity PRODUCT(F(I),I,A,B) =
  322.      1/PRODUCT(F(I),I,B+1,A-1) when A>B.
  323.  
  324.  
  325.  - Function: RADCAN (exp)
  326.      simplifies exp, which can contain logs, exponentials, and
  327.      radicals, by converting it into a form which is canonical over a
  328.      large class of expressions and a given ordering of variables; that
  329.      is, all functionally equivalent forms are mapped into a unique
  330.      form.  For a somewhat larger class of expressions, RADCAN produces
  331.      a regular form.  Two equivalent expressions in this class will not
  332.      necessarily have the same appearance, but their difference will be
  333.      simplified by RADCAN to zero.  For some expressions RADCAN can be
  334.      quite time consuming.  This is the cost of exploring certain
  335.      relationships among the components of the expression for
  336.      simplifications based on factoring and partial-fraction expansions
  337.      of exponents.  %E_TO_NUMLOG (default: [FALSE]) - when set to TRUE,
  338.      for "r" some rational number, and "x" some expression,
  339.      %E^(r*LOG(x)) will be simplified into x^r .  RADEXPAND[TRUE] when
  340.      set to FALSE will inhibit certain transformations:
  341.      RADCAN(SQRT(1-X)) will remain SQRT(1-X) and will not become %I
  342.      SQRT(X-1).  RADCAN(SQRT(X^2-2*X+1)) will remain SQRT(X^2-2*X + 1)
  343.      and will not be transformed to X- 1.  Do EXAMPLE(RADCAN); for
  344.      examples.
  345.  
  346.  
  347.  - Variable: RADEXPAND
  348.      default: [TRUE] - if set to ALL will cause nth roots of factors of
  349.      a product which are powers of n to be pulled outside of the
  350.      radical.  E.g. if RADEXPAND is ALL, SQRT(16*X^2) will become 4*X .
  351.      More particularly, consider SQRT(X^2).  (a) If RADEXPAND is ALL or
  352.      ASSUME(X>0) has been done, SQRT(X^2) will become X.  (b) If
  353.      RADEXPAND is TRUE and DOMAIN is REAL (its default), SQRT(X^2) will
  354.      become ABS(X).  (c) If RADEXPAND is FALSE, or RADEXPAND is TRUE
  355.      and DOMAIN is COMPLEX, SQRT(X^2) will be returned.  (The notion of
  356.      DOMAIN with settings of REAL or COMPLEX is still in its infancy.
  357.      Note that its setting here only matters when RADEXPAND is TRUE.)
  358.  
  359.  
  360.  - Variable: RADPRODEXPAND
  361.      - this switch has been renamed RADEXPAND.
  362.  
  363.  
  364.  - Variable: RADSUBSTFLAG
  365.      default: [FALSE] - if TRUE permits RATSUBST to make substitutions
  366.      such as U for SQRT(X) in X.
  367.  
  368.  
  369.  - declaration: RASSOCIATIVE
  370.      - If DECLARE(G,RASSOCIATIVE); is done, this tells the simplifier
  371.      that G is right-associative.  E.g.  G(G(A,B),G(C,D)) will simplify
  372.      to G(A,G(B,G(C,D))).
  373.  
  374.  
  375.  - Function: SCSIMP (exp,rule1, rule2,...,rulen)
  376.      Sequential Comparative Simplification [Stoute]) takes an
  377.      expression (its first argument) and a set of identities, or rules
  378.      (its other arguments) and tries simplifying.  If a smaller
  379.      expression is obtained, the process repeats.  Otherwise after all
  380.      simplifications are tried, it returns the original answer.  For
  381.      examples, try EXAMPLE(SCSIMP); .
  382.  
  383.  
  384.  - Function: SIMP
  385.      causes exp to be simplified regardless of the setting of the
  386.      switch SIMP which inhibits simplification if FALSE.
  387.  
  388.  
  389.  - Variable: SIMPSUM
  390.      default: [FALSE] - if TRUE, the result of a SUM is simplified.
  391.      This simplification may sometimes be able to produce a closed
  392.      form.  If SIMPSUM is FALSE or if 'SUM is used, the value is a sum
  393.      noun form which is a representation of the sigma notation used in
  394.      mathematics.
  395.  
  396.  
  397.  - Function: SUMCONTRACT (expr)
  398.      will combine all sums of an addition that have upper and lower
  399.      bounds that differ by constants. The result will be an expression
  400.      containing one summation for each set of such summations added to
  401.      all appropriate extra terms that had to be extracted to form this
  402.      sum.  SUMCONTRACT will combine all compatible sums and use one of
  403.      the indices from one of the sums if it can, and then try to form a
  404.      reasonable index if it cannot use any supplied.  It may be
  405.      necessary to do an INTOSUM(expr) before the SUMCONTRACT.
  406.  
  407.  
  408.  - Variable: SUMEXPAND
  409.      default: [FALSE] if TRUE, products of sums and exponentiated sums
  410.      are converted into nested sums. For example:
  411.                   SUMEXPAND:TRUE$
  412.                   SUM(F(I),I,0,M)*SUM(G(J),J,0,N); ->
  413.                                   'SUM('SUM(F(I1)*G(I2),I2,0,N),I1,0,M)
  414.                   SUM(F(I),I,0,M)^2; -> 'SUM('SUM(F(I3)*F(I4),I4,0,M),I3,0,M)
  415.  
  416.      If FALSE, they are left alone.  See also CAUCHYSUM.
  417.  
  418.  
  419.  - Variable: SUMHACK
  420.      default: [FALSE] - if set to TRUE then SUM(F(I),I,3,1); will yield
  421.      -F(2), by the identity SUM(F(I),I,A,B) = - SUM(F(I),I,B+1,A-1)
  422.      when A>B.
  423.  
  424.  
  425.  - Variable: SUMSPLITFACT
  426.      default: [TRUE] - if set to FALSE will cause MINFACTORIAL to be
  427.      applied after a FACTCOMB.
  428.  
  429.  
  430.  - declaration: SYMMETRIC
  431.      - If DECLARE(H,SYMMETRIC); is done, this tells the simplifier that
  432.      H is a symmetric function.  E.g. H(X,Z,Y) will simplify to H(X, Y,
  433.      Z).  This is the same as COMMUTATIVE.
  434.  
  435.  
  436.  - Function: UNKNOWN (exp)
  437.      returns TRUE iff exp contains an operator or function not known to
  438.      the built-in simplifier.
  439.  
  440.  
  441. 
  442. File: maxima.info,  Node: Plotting,  Next: Input and Output,  Prev: Simplification,  Up: Top
  443.  
  444. Plotting
  445. ********
  446.  
  447. * Menu:
  448.  
  449. * Definitions for Plotting::
  450.  
  451. 
  452. File: maxima.info,  Node: Definitions for Plotting,  Prev: Plotting,  Up: Plotting
  453.  
  454. Definitions for Plotting
  455. ========================
  456.  
  457.  - Variable: IN_NETMATH [FALSE]
  458.      If not nil, then plot2d will output a representation of the plot
  459.      which is suitable for openplot functions.
  460.  
  461.  - Function: OPENPLOT_CURVES list rest-options
  462.      Takes a list of curves such as
  463.           [[x1,y1,x2,y2,...],[u1,v1,u2,v2,...],..]
  464.           or
  465.            [[[x1,y1],[x2,y2],...],.. ]
  466.      and plots them.  This is similar to xgraph_curves, but uses the
  467.      open plot routines.  Addtional symbol arguments may be given such
  468.      as ` "{xrange -3 4}" ' The following plots two curves, using big
  469.      points, labeling the first one `jim' and the second one `jane'.
  470.           openplot_curves([["{plotpoints 1} {pointsize 6} {label jim}
  471.                 {text {xaxislabel {joe is nice}}}"] ,
  472.                 [1,2,3,4,5,6,7,8],
  473.                 ["{label jane} {color pink } "], [3,1,4,2,5,7]]);
  474.  
  475.      Some other special keywords are xfun, color, plotpoints,
  476.      linecolors, pointsize, nolines, bargraph, labelposition,
  477.      xaxislabel, and yaxislabel.
  478.  
  479.  
  480.  - Function: PLOT2D (expr,range,...,options,..)
  481.  - Function: PLOT2D ([expr1,expr2,..,exprn],xrange,...,options,..)
  482.  - Function: PLOT2D (parametric_expr)
  483.  - Function: PLOT2D ([..,expr,..,parametric_expr,..],xrange,...,options)
  484.      EXPR is an expression to be plotted on y axis as a function of 1
  485.      variable.  RANGE is of the form [var,min,max] and expr is assumed
  486.      to be an expression to be plotted against VAR.  In the second form
  487.      of the function a list of expressions may be given to plot against
  488.      VAR.   Truncation in the y direction will be performed, for the
  489.      default y range.   It may be specified as an option or using
  490.      SET_PLOT_OPTION.
  491.  
  492.           (C1) plot2d(sin(x),[x,-5,5]);
  493.           (C2) plot2d(sec(x),[x,-2,2],[y,-20,20],[nticks,200]);
  494.  
  495.      Anywhere there may be an EXPR you may also use a parametric
  496.      expression: PARAMETRIC_EXPR is a Maxima list of the form
  497.      `[parametric, xexpr, yexpr, trange, ..options]' Here XEXPR and
  498.      YEXPR are functions of 1 variable VAR which is the first element
  499.      of the range TRANGE.  The plot is of the path traced out by the
  500.      pair `[XEXPR, YEXPR]' as VAR varies in TRANGE.  In the following
  501.      example, we plot a circle, then we do the plot with only a few
  502.      points used, so that we get a star, and finally we plot this
  503.      together with an ordinary function of X.
  504.  
  505.           (C1) plot2d([parametric,cos(t),sin(t),[t,-%pi*2,%pi*2]]);
  506.           (C2) plot2d([parametric,cos(t),sin(t),[t,-%pi*2,%pi*2],
  507.                   [nticks,8]]);
  508.           (C3) plot2d([x^3+2,[parametric,cos(t),sin(t),[t,-5,5]]],
  509.                   [x,-3,3]);
  510.  
  511.  
  512.  - Function: xgraph_curves (list)
  513.      graphs the list of `point sets' given in list by using xgraph.
  514.  
  515.      A point set may be of the form
  516.  
  517.           [x0,y0,x1,y1,x2,y2,...] or
  518.           [[x0,y0],[x1,y1],....]
  519.      A point set may also contain symbols which give labels or other
  520.      information.
  521.  
  522.            xgraph_curves([pt_set1,pt_set2,pt_set3]);
  523.      would graph the three point sets as three curves.
  524.  
  525.           pt_set:append(["NoLines: True","LargePixels: true"],
  526.                   [x0,y0,x1,y1,...])
  527.  
  528.      would make the point set [and subsequent ones], have no lines
  529.      between points, and to use large pixels.  See the man page on
  530.      xgraph for more options to specify.
  531.  
  532.           pt_set:append([concat("\"","x^2+y")],[x0,y0,x1,y1,...])
  533.  
  534.      would make there be a "label" of "x^2+y" for this particular point
  535.      set.    The `"' at the beginning is what tells xgraph this is a
  536.      label.
  537.  
  538.           pt_set:append([concat("TitleText: Sample Data")],[x0,...])
  539.  
  540.      would make the main title of the plot be "Sample Data" instead of
  541.      "Maxima PLot".
  542.  
  543.      To make a bar graph with bars which are .2 units wide, and to plot
  544.      two possibly different such bar graphs:
  545.           xgraph_curves(
  546.                  [append(["BarGraph: true","NoLines: true","BarWidth: .2"],
  547.                          create_list([i-.2,i^2],i,1,3)),
  548.                   append(["BarGraph: true","NoLines: true","BarWidth: .2"],
  549.                      create_list([i+.2,.7*i^2],i,1,3))
  550.           ]);
  551.  
  552.      A temporary file `xgraph-out' is used.
  553.  
  554.  
  555.  - Variable: PLOT_OPTIONS
  556.      Members of this list indicate defaults for plotting.  They may be
  557.      altered using SET_PLOT_OPTION
  558.  
  559.           [X, - 3, 3]
  560.           [Y, - 3, 3]
  561.  
  562.      are the x range and y range respectively.
  563.  
  564.      [TRANSFORM_XY, FALSE] if not false, should be the output of
  565.  
  566.           make_transform([x,y,z], [f1(x,y,z),f2(x,y,z),f3(x,y,z)])
  567.      which produces a transformation from 3 space to 3 space, which
  568.      will be applied to the graph.   A built in one is polar_xy which
  569.      gives the same as
  570.  
  571.           make_transform([r,th,z],[r*cos(th),r*sin(th),z])
  572.  
  573.      [RUN_VIEWER,TRUE] if not false, means run the viewer software -
  574.      don't just output a data file.
  575.  
  576.      [GRID,30,30] means plot3d should divide the x range into 30
  577.      intervals and similarly the y range.
  578.  
  579.      [COLOUR_Z,false] applies to colouring done with plot_format ps.
  580.  
  581.      [PLOT_FORMAT,OPENMATH] is for plot3d and currently  OPENMATH,
  582.      GNUPLOT, PS, and GEOMVIEW are supported.
  583.  
  584.      There are good quality public domain viewers for these formats.
  585.      They are openmath, izic, gnuplot, ghostview, and geomview.
  586.  
  587.      The Openmath viewer is in the distribution, and is based on tcl/tk.
  588.      The executable is `maxima/bin/omplotdata'.  The viewer lets you
  589.      zoom in, slide around, and rotate (if 3 dimensional).  This format
  590.      is also the one used by netmath, for making plots with Netmath.
  591.      (see `http://www.ma.utexas.edu/users/wfs/netmath.html')
  592.  
  593.      geomview is from the Geometry Center at the University of
  594.      Minnesota, and is available from
  595.      `http://www.geom.umn.edu/software/download/geomview.html' or by
  596.      anonymous ftp from
  597.      `ftp://ftp.geom.umn.edu/pub/software/geomview/'.  It is currently
  598.      not quite as pretty as izic, but provides excellent support for
  599.      multiple objects and multiple lights.
  600.  
  601.      gnuplot is everywhere as is ghostview.   We also provide mgnuplot,
  602.      a tcl interface for gnuplot, which lets you rotate the plots using
  603.      the mouse and a scale.
  604.  
  605.      izic is available by ftp from zenon.inria.fr.  Contact one of
  606.  
  607.      {fournier,kajler,mourrain}@sophia.inria.fr.
  608.  
  609.      It has beautiful colour gouraud shading, and very fast wireframe.
  610.      It runs on X windows.
  611.  
  612.  
  613.  - Function: PLOT3D (expr,xrange,yrange,...,options,..)
  614.  - Function: PLOT3D ([expr1,expr2,expr3],xrange,yrange,...,options,..)
  615.           plot3d(2^(-u^2+v^2),[u,-5,5],[v,-7,7]);
  616.      would plot z = 2^(-u^2+v^2) with u and v varying in [-5,5] and
  617.      [-7,7] respectively, and with u on the x axis, and v on the y axis.
  618.  
  619.      An example of the second pattern of arguments is
  620.           plot3d([cos(x)*(3+y*cos(x/2)),sin(x)*(3+y*cos(x/2)),y*sin(x/2)],
  621.              [x,-%pi,%pi],[y,-1,1],['grid,50,15])
  622.  
  623.      which will plot a moebius band, parametrized by the 3 expressions
  624.      given as the first argument to plot3d.  An additional optional
  625.      argument [grid,50,15] gives the grid number of rectangles in the x
  626.      direction and y direction.
  627.  
  628.           /* REal part of z ^ 1/3 */
  629.            plot3d(r^.33*cos(th/3),[r,0,1],[th,0,6*%pi],
  630.                ['grid,12,80],['PLOT_FORMAT,ps],
  631.                ['TRANSFORM_XY,POLAR_TO_XY],['VIEW_DIRECTION,1,1,1.4],
  632.                ['COLOUR_Z,true])
  633.  
  634.      Here the View_direction indicates the direction from which we take
  635.      a projection.  We actually do this from infinitely far away, but
  636.      parallel to the line from view_direction to the origin.  This is
  637.      currently only used in 'ps' plot_format, since the other viewers
  638.      allow interactive rotating of the object.
  639.  
  640.      Another example is a moebius band:
  641.           plot3d([cos(x)*(3+y*cos(x/2)),
  642.                     sin(x)*(3+y*cos(x/2)),y*sin(x/2)],
  643.                      [x,-%pi,%pi],[y,-1,1],['grid,50,15]);
  644.  
  645.      or a klein bottle:
  646.  
  647.           plot3d([5*cos(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0) - 10.0,
  648.                     -5*sin(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0),
  649.                      5*(-sin(x/2)*cos(y)+cos(x/2)*sin(2*y))],
  650.                      [x,-%pi,%pi],[y,-%pi,%pi],['grid,40,40])
  651.  
  652.      or a torus
  653.           plot3d([cos(y)*(10.0+6*cos(x)),
  654.                      sin(y)*(10.0+6*cos(x)),
  655.                      -6*sin(x)], [x,0,2*%pi],[y,0,2*%pi],
  656.                       ['grid,40,40])
  657.      We can output to gnplot too:
  658.  
  659.            plot3d(2^(x^2-y^2),[x,-1,1],[y,-2,2],[plot_format,gnuplot])
  660.  
  661.      Sometimes you may need to define a function to plot the
  662.      expression.  All the arguments to plot3d are evaluated before
  663.      being passed to plot3d, and so trying to make an expression which
  664.      does just what you want may be difficult, and it is just easier to
  665.      make a function.
  666.           M:MATRIX([1,2,3,4],[1,2,3,2],[1,2,3,4],[1,2,3,3])$
  667.           f(x,y):=float(M[?round(x),?round(y)]);
  668.           plot3d(f,[x,1,4],[y,1,4],['grid,4,4]);
  669.  
  670.  
  671.  - Function: PLOT2D_PS (expr,range)
  672.      writes to pstream a sequence of postscript commands which plot
  673.      EXPR for RANGE.  EXPR should be an expression of 1 variable.
  674.      RANGE should be of the form [variable,min,max] over which to plot
  675.      expr.  see CLOSEPS.
  676.  
  677.  
  678.  - Function: CLOSEPS ()
  679.      This should usually becalled at the end of a sequence of plotting
  680.      commands.   It closes the current output stream PSTREAM, and sets
  681.      it to nil.   It also may be called at the start of a plot, to
  682.      ensure pstream is closed if it was open.    All commands which
  683.      write to pstream, open it if necessary.   CLOSEPS is separate from
  684.      the other plotting commands, since we may want to plot 2 ranges or
  685.      superimpose several plots, and so must keep the stream open.
  686.  
  687.  - Function: SET_PLOT_OPTION (option)
  688.      option is of the format of one of the elements of the PLOT_OPTIONS
  689.      list.  Thus
  690.           SET_PLOT_OPTION([grid,30,40])
  691.      would change the default grid used by plot3d.   Note that if the
  692.      symbol grid has a value, then you should quote it here:
  693.           SET_PLOT_OPTION(['grid,30,40])
  694.      so that the value will not be substituted.
  695.  
  696.  - Function: PSDRAW_CURVE (ptlist)
  697.      Draws a curve connecting the points in PTLIST.   The latter may be
  698.      of the form [x0,y0,x1,y1,...] or [[x0,y0],[x1,y1],...]  The
  699.      function JOIN is handy for taking a list of x's and a list of y's
  700.      and splicing them together.  PSDRAW_CURVE simply invokes the more
  701.      primitive function PSCURVE.   Here is the definition:
  702.  
  703.           (defun $psdraw_curve (lis)
  704.             (p "newpath")
  705.             ($pscurve lis)
  706.             (p "stroke"))
  707.  
  708.      ?DRAW2D  may also be used to produce a list
  709.            points1:?draw2d(1/x,[.05,10],.03)
  710.  
  711.  
  712.  - Function: PSCOM (com)
  713.      COM will be inserted in the poscript file eg
  714.             pscom("4.5 72 mul 5.5 72 mul translate  14 14 scale");
  715.  
  716.  
  717. 
  718. File: maxima.info,  Node: Input and Output,  Next: Floating Point,  Prev: Plotting,  Up: Top
  719.  
  720. Input and Output
  721. ****************
  722.  
  723. * Menu:
  724.  
  725. * Introduction to Input and Output::
  726. * FILES::
  727. * PLAYBACK::
  728. * Definitions for Input and Output::
  729.  
  730. 
  731. File: maxima.info,  Node: Introduction to Input and Output,  Next: FILES,  Prev: Input and Output,  Up: Input and Output
  732.  
  733. Introduction to Input and Output
  734. ================================
  735.  
  736. 
  737. File: maxima.info,  Node: FILES,  Next: PLAYBACK,  Prev: Introduction to Input and Output,  Up: Input and Output
  738.  
  739. FILES
  740. =====
  741.  
  742.    - A file is simply an area on a particular storage device which
  743. contains data or text.  The only storage devices which are used on the
  744. MC machine are disks and tapes.  Files on the disks are figuratively
  745. grouped into "directories".  A directory is just a list of all the
  746. files stored under a given user name.  Do DESCRIBE(FILEOP); for details
  747. of how you may inspect your files using MACSYMA.  Other commands which
  748. deal with files are: SAVE, FASSAVE, STORE, LOAD, LOADFILE, RESTORE,
  749. UNSTORE, STRINGOUT, BATCH, BATCON, DEMO, WRITEFILE, CLOSEFILE, DELFILE,
  750. REMFILE, and APPENDFILE.
  751.  
  752. 
  753. File: maxima.info,  Node: PLAYBACK,  Next: Definitions for Input and Output,  Prev: FILES,  Up: Input and Output
  754.  
  755. PLAYBACK
  756. ========
  757.  
  758.    It is possible to play back the input lines in a temporary scroll
  759. down window, and so not lose ones current work.  This can be done by
  760. typing Function  E.  A numeric argument tells it the line number to
  761. start at, otherwise it will go back about 40 lines.
  762.  
  763.